<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
	
			<li class="active" id="list"><a href="{:url('station/index')}"><if condition="$incubator_type eq 1">园区<else />众创</if></a></li>
			<li><a href='{:url('station/addStation',array('cate'=>$incubator_type))}'>添加</a></li>
			<!-- 	<li><a href="{:url('user/add')}">{:lang('ADMIN_USER_ADD')}</a></li> -->
		</ul>
		<form class="well form-inline margin-top-20" method="post" <if condition="$incubator_type eq 1"> action="{:url('station/index')}" <else /> action="{:url('station/roomIndex')}" </if>>
		<if condition="$incubator_type eq 1"><input type="hidden" name="incubator_type" value="1"><else /><input type="hidden" name="incubator_type" value="2"></if>
			空间名:
			<input type="text" class="form-control" name="station_name" style="width: 120px;" value="{$station_name}" placeholder="请输入空间名">
			地址:
			<input type="text" class="form-control" name="address" style="width: 120px;" value="{$address}" placeholder="请输入地址">
			
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" <if condition="$incubator_type eq 1">href="{:url('station/index')}"<else />href="{:url('station/roomIndex')}"</if>>清空</a>
		</form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>园区名</th>
					<th>面积</th>
					<th>单价</th>
					<th>状态</th>
					<th>地址</th>
					<th>电话</th>
					<th>编号</th>
					<th>所属孵化器</th>
					<th width="130">操作</th>
				</tr>
			</thead>
			<tbody>
				<!-- 	<php>$user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));</php> -->
				
				<foreach name="list" item="vo">
					<tr>
					    <input type="hidden" name="id" value="">
						<td>{$vo.id}</td>
						<td><a class="btn " href='{:url('station/detailStation',array('id'=>$vo.id,'cate'=>$incubator_type))}'>{$vo.station_name}</a></td>
						<td>{$vo.covered_area}</td>
						<td>{$vo.price} 元/平方米*天</td>
						<td>
							<if condition="$vo['is_use'] eq 2">
								禁用
								<else />
								可用
							</if>
						</td>
						<td>{$vo.address}</td>
						<td>{$vo.tel}</td>
						<td>{$vo.space_num}</td>
						<td>{:get_incubator_name($vo['incubator_id'])}</td>
						<td>
							<a class='edit' href='{:url('Station/editStation',array('id'=>$vo.id,'cate'=>$incubator_type))}' >编辑</a>
							|
							<a class='del' id="{$vo.id}">删除</a>
						</td>


					</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	

	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
<script>
	$(function(){
		// var station="{$station_name}";
		// var address="{$address}";
		// //alert(station);
		// if(station){
		// 	$("input[name=station_name]").val(station);
		// }
		// if(address){
		// 	$("input[name=address]").val(address);
		// }
		//alert(123132);

	})
	// alert(dasda);
	$(".del").click(
	    function(){
	    if(confirm("确认要删除吗")){
	    	    var id=$(this).attr("id");
	    	    $.post("{:url('delStation')}",
	    		{id:id},
	    		function(data,status){

	    			location.href="{:url('index')}";
	    		});
	    }
		
		
	    }
	);


</script>